#!/usr/bin/env perl
use strict;
use warnings;



open(my $in, "<", "GRL_PLHC_p543_Muons.xml") or die "Can't open test.xml: $!";


while(<$in>) {
  s/"\/>/ ) ||/;
  s/<Run>/if( ( R == /g;
  s/<\/Run>/ \) && \(/;
  s/<LBRange Start="/( l >= /g;
  s/" End="/ && l <= /g;
  s/<\/LumiBlockCollection>/false ) ){ return true;}/g;

  s/<LumiBlockCollection>//g;
  s/<\/NamedLumiRange>//g;
  s/<\/LumiRangeCollection>//g;

  print "$_";
}  

close $in or die "$in: $!";
